<div id="content_area">
	<div id="content_left">
		<ul id="navigation">
			<li><a href="javascript: void(0);" onclick="showBannerDir('media')">Media</a>
				<ul>
				<?php 
					foreach ($this->dirs as $dir) : 
					if ($dir === '.' || $dir === '..') {
		                continue; 
		           	}
				?>
					<li><a href="javascript: void(0);" onclick="showBannerDir('<?php echo $dir; ?>')"><?php echo $dir; ?></a></li>
				<?php endforeach; ?>
				</ul>
			</li>
		</ul>
	</div>
	<div id="content_right">
		<div id="msgbox"><?php echo $this->msg; ?></div>
		<div id="loader"></div>
		<div class="clear"></div>
		<div id="dataviewer">
			<?php 
				foreach ($this->dirs as $dir) :
					if($dir === '.' || $dir === '..')
					{
						continue;
					} else {
						$img_path = $this->main_dir . "/" . $dir;
		            	if(is_dir($img_path)) // check whether image or directory
		            	{
		            		$file_icon = "<img src='/images/admin/folder_icon.png' />"; 
		            		$toolbar = "";          		
						} else {
							$file_icon = "<img src='/" . $main_dir . "/" . $dir . "' width='100' height='45' />";
							$toolbar = "<a href='javascript: void(0);' onclick='editPromoBanner(\"" . $img_path . "\")'><img src='/images/admin/edit.gif' width='15' height='15' /></a>&nbsp;&nbsp;&nbsp;<a href='javascript: void(0);' onclick='deleteImage(\"" . $img_path . "\")'><img src='/images/admin/disable.gif' width='15' height='15' /></a>";
						}
						
						// file_icon - change the folder icon if $dir is image
						
		            	$list_dirs = "<div style='float: left;'>" . $file_icon . "<br /><p class='txt_size11' style='text-align: center;'>" . $dir . "</p><p style='text-align: center;'>" . $toolbar . "</p></div>";
			            
			            echo "<a href='javascript: void(0);' onclick='showBannerDir(\"" . $dir . "\")'>" . $list_dirs . "</a>";
					}
				endforeach;
			?>
		</div>
		<div id="upload_form">
			<form name="frmBanner" method="POST" action="/admin/content/uploader" enctype="multipart/form-data">
				<p>Promo Banners (Slider 1) Upload Form</p><p class="small_hint">Upload files (Maximum Size: 10 MB)</p>
				<div class="form_label">Banner Title</div>
				<div class="form_element" style="margin: 0 0 0 45px;"><input type="text" name="txtBannerTitle" id="txtBannerTitle" value="" style="width: 300px;" /></div>
				<div class="clear"></div>
				<div class="form_label">Banner Description</div>
				<div class="form_element"><textarea name="txtbannerDesc" id="txtBannerDesc" cols="40" rows="5"></textarea></div>
				<div class="clear"></div>
				<div class="form_label">Banner URL</div>
				<div class="form_element" style="margin: 0 0 10px 45px;"><input type="text" name="txtBannerURL" id="txtBannerURL" value="" style="width: 300px;" /></div>
				<div class="clear"></div>
				<div class="form_label">Is Active</div>
				<div class="form_element" style="margin: 0 0 10px 55px;"><input type="checkbox" name="txtIsActive" id="txtIsActive" value="1" /></div>
				<div class="clear"></div>
				<div class="form_label">Filename</div>
				<div class="form_element" style="margin: 0 0 10px 60px;"><input type="file" name="bannerimage" id="bannerimage" size="20" /></div>
				<div class="clear"></div>
				<div class="form_element" style="margin: 0 0 10px 100px;">
				<input type="submit" name="btnUpload" id="btnUpload" value="Add Banner" class="button" />
				<input type="reset" name="btnReset" id="" value="Clear Form" class="button" />
				<input type="hidden" name="txtPBannerId" id="txtPBannerId" value="" />
				<input type="hidden" name="txtBannerImg" id="txtBannerImg" value="" />
				</div>
			</form>
		</div>
	</div>
</div>